#ifndef BINANCEC__SERVER_COINPRICE_H
#define BINANCEC__SERVER_COINPRICE_H

#include <iostream>
#include <mutex>
#include "vector"
#include <map>

enum  Coin {
    ETH = 1,
    BNB = 2
};

class CoinPrice
{
public:
    static CoinPrice* getInstance()
    {
        static CoinPrice instance;
        return &instance;
    }
    std::mutex m_mutex;
    void updataPrice(Coin, int);
    std::vector<int>& readPriceAndCount(Coin);

    std::map<int, std::vector<int>> recordPrice;         //第一位表示价格，第二位表示数量，后续可以考虑不存在本地，使用redis存储
};

#endif //BINANCEC__SERVER_COINPRICE_H
